package data.reader;

import java.util.ArrayList;

import data.obj.StatBonus;

public class StatBonusReader extends GenericFileReader<StatBonus>
{

	public StatBonusReader(String filePath)
	{
		super(filePath);
	}

	@Override
	public ArrayList<StatBonus> get()
	{
		return list;
	}

	@Override
	protected StatBonus newInstance(String row)
	{

		String[] parts = row.split(" |,|;");
		try
		{
			int stat = Integer.parseInt(parts[0]);
			int bonus = Integer.parseInt(parts[1]);
			double devPt = Double.parseDouble(parts[2]);
			double ppt = Double.parseDouble(parts[2]);

			return new StatBonus(stat, bonus, devPt, ppt);
		} catch (Exception e)
		{
			return null;
		}

	}
}
